﻿
//

//


namespace EMSNet.Core.Service;

/// <summary>
/// 系统用户事件处理类
/// </summary>
public class SysUserEventHandler : ISingleton
{
    private event EventHandler Event;

    /// <summary>
    /// 订阅
    /// </summary>
    /// <param name="eventHandler"></param>
    public void Subscribe(EventHandler eventHandler) => Event += eventHandler;

    /// <summary>
    /// 发布事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="eventType"></param>
    /// <param name="input"></param>
    public void OnEvent(object sender, SysUserEventTypeEnum eventType, object input)
    {
        Event?.Invoke(sender, new SysUserEventArgs(eventType, input));
    }
}